package com.guigu.qingcheng.service.impl;

import com.guigu.qingcheng.mapper.AuditSpuIndoMapper;
import com.guigu.qingcheng.pojo.AuditSpuInfo;
import com.guigu.qingcheng.service.AuditSpuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class AuditSpuInfoServiceImpl implements AuditSpuInfoService {
    @Autowired(required = false)
    private AuditSpuIndoMapper auditSpuIndoMapper;

    @Override
    public void insertAuditSpuInf(AuditSpuInfo auditSpuInfo) {
        auditSpuIndoMapper.insert(auditSpuInfo);
    }

    @Override
    public List<AuditSpuInfo> queryBySkuId(String id) {
        Example example = new Example(AuditSpuInfo.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("skuId", id);
        List<AuditSpuInfo> auditSpuInfos = auditSpuIndoMapper.selectByExample(example);
        return auditSpuInfos;
    }
}
